Repository navigation
chore(cli): split static descriptor reader from theme-discovery - #14161
Rajratna-D wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested: the split itself checks out, and one changeset line needs to say what actually leaves the import graph.
-
The changeset says
icon-set-discovery.mjsandicon-definition-discovery.mjs"do not pulldoc-compilerinto their import graph", butstatic-descriptor.mjsstill imports../doc-compiler/stored-docs.mjs; please name what drops out instead, for example "…no longer importdoc-compiler/compile.mjs, whose graph reaches the dynamicimport(url)infs/import-url.mjs." -
Non-blocking: please carry the reason comments that explained the cache and the JSDoc type check into
static-descriptor.mjsverbatim, and give its header the@input,@outputand@positionlines its sibling modules have.
Reproduced locally, the seven test files that import these modules pass, the moved code is identical to the old block apart from its comments, theme-discovery.mjs keeps its exports, and the icon modules no longer reach fs/import-url.mjs. CI has not run on this head yet; a maintainer adds the ci:run label so it runs.
Claims and files checked
Review mode: same-head; reason: none
- Live title: "chore(cli): split static descriptor reader from theme-discovery". Verified: the reader moves out of theme discovery.
- Changed rules since the last review (0): none.
- Claim: a follow-up to the earlier pull request, at the maintainer's suggestion. Verified in that pull request's comments.
- Claim: the icon modules used to import the reader (and, for icon sets, the ignore filter) from theme discovery, which pulled the doc compiler and the URL importer into their graph. Verified on the base import graph.
- Claim: bundlers that follow icon discovery met that dynamic import. Reported.
- Claim: no behavior change; every caller keeps the same exports, runtime behavior and single discovery path through theme discovery's re-exports. Verified: every importer of the moved names found by a repository-wide search, identical executable code, the same export lists, and the related tests pass locally.
- Claim: five symbols are extracted, re-exported, and imported directly by the icon modules, with a changeset. Verified.
- Claim: the cache map is removed from theme discovery. Verified; it moved with the reader rather than being dropped.
- Claim: the new module imports only the file system, the stored-docs store, the read recorder and the lazy dependency loader, and reaches neither the doc importer nor the URL importer. Verified, directly and through every module it reaches.
- Claim: the strict typecheck has no errors in the touched files, with two pre-existing template errors. Verified locally: the same two errors, none in the touched files.
- Claim: the pre-review checklist reports no findings. Reported.
- Claim: the pre-commit checks (changesets, CLI structure, package boundaries, formatting) pass. Verified locally.
- Claim: no workflow, action or CI script changes. Verified.
- Claim: no public API, product behavior, visual or policy change, and no internal context in public text. Verified.
- Claim (changeset): the icon modules do not pull the doc compiler into their import graph. False: the stored-docs module stays.
- File
.changeset/static-descriptor-split.md: finding (the claim above). - File
packages/cli/foundation/discovery/icon-definition-discovery.mjs: clear. - File
packages/cli/foundation/discovery/icon-set-discovery.mjs: clear. - File
packages/cli/foundation/discovery/static-descriptor.mjs: clear, apart from the non-blocking comment and header notes. - File
packages/cli/foundation/discovery/theme-discovery.mjs: clear.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet; a maintainer adds the ci:run label so it runs.
The changeset now names exactly what leaves the icon modules' import graph, and the split keeps one reader and one cache behind the re-exports in theme-discovery.mjs. Reproduced locally, 18 related test files pass, and a static trace shows neither icon module reaches doc-compiler/compile.mjs or fs/import-url.mjs any more.
- Non-blocking:
static-descriptor.mjsstill lacks two reason comments from the old location, onstaticThemeValue(the synchronous-API constraint) and on theoptionsparameter ofreadStaticDescriptorValue(whatdataaccepts), andscripts/generate-stored-docs.mjs:186still namestheme-discovery.mjsas where the published package reads the stored value.
Claims and files checked
Review mode: full; reason: author-not-engowner
- Live title: "chore(cli): split static descriptor reader from theme-discovery". Verified: the reader moves out of theme discovery into its own module.
- Claim: a follow-up to the earlier pull request, at the maintainer's suggestion. Verified in that pull request's comments.
- Claim: the icon modules used to take the reader (and, for icon sets, the ignore filter) from theme discovery, whose imports reach the doc compiler and, through it, the URL importer. Verified on the base import graph, along the exact chain the description gives.
- Claim: bundlers that follow icon-set discovery met the URL importer's dynamic import. Reported.
- Claim: no behavior change; every caller of the three modules keeps the same exports, runtime behavior and single discovery path through the re-exports. Verified: identical export lists on both trees, every importer of the moved names found by a repository-wide search either imports the new module directly (the two icon modules) or goes through the re-export, the same module instance, identical executable code apart from imports, no top-level side effects in the modules the icon code no longer loads, and the related tests pass locally.
- Claim: five symbols move to the new module and theme discovery re-exports them. Verified.
- Claim: the cache map is removed from theme discovery. Verified: it moved with the reader, and theme discovery no longer references it.
- Claim: the icon modules import the new module directly. Verified.
- Claim: a chore changeset is added. Verified; the changeset check passes locally.
- Claim: the new module imports only the file system, the stored-docs store, the read recorder and the lazy dependency loader, and reaches neither the doc importer nor the URL importer. Verified, directly and through every module it reaches.
- Claim: the strict typecheck reports no errors in the touched files and two existing errors in template pages. Verified locally: the same two errors, in untouched pages.
- Claim: no workflow, action or CI script changes. Verified.
- Claim: no public API, product behavior, visual or policy change, and no internal context in public text. Verified.
- Claim: the pre-review checklist reports no findings. Reported.
- Claim: the pre-commit checks (changesets, CLI structure, package boundaries, formatting) pass. Verified locally.
- Claim (changeset): the icon modules no longer import the doc compiler's compile module, whose graph reaches the URL importer's dynamic import. Verified on the head import graph.
- File
.changeset/static-descriptor-split.md: clear. - File
packages/cli/foundation/discovery/icon-definition-discovery.mjs: clear. - File
packages/cli/foundation/discovery/icon-set-discovery.mjs: clear. - File
packages/cli/foundation/discovery/static-descriptor.mjs: clear, apart from the non-blocking comment note. - File
packages/cli/foundation/discovery/theme-discovery.mjs: clear.
|
🤖 (Posted by Cindy's agent.) Welcome, @Rajratna-D, and thank you for this clean split! The automated review approved it, and we'll start CI now. Three small leftovers from the move, to get it to a completely clean review: |
Thank you @cixzhang! Pushed |
PR Analysis Report🔎 Preview ·
|
|
/approve-spec 47e7b50 |
There was a problem hiding this comment.
Approved pending CI: the CI, Lint and CLI smoke-test runs pass on this head, and the CI pass that follows a review has not run yet.
The split is clean: the moved code is identical, theme-discovery.mjs keeps every export, and neither icon module's import graph reaches doc-compiler/compile.mjs or fs/import-url.mjs any more (traced locally, and the related tests pass locally).
- Non-blocking: four doc lines did not move: the tails of the
descriptorStoreKeyandreadDescriptorSourceJSDoc and the summaries ofauthoringTypeReandjsdocAliases(static-descriptor.mjs:192,:203,:255,:437); carrying them over verbatim fromtheme-discovery.mjskeeps the contract and constraints they state.
Claims and files checked
Review mode: full; reason: author-not-engowner
- Claim, title: the static descriptor reader is split out of theme discovery. Verified (
static-descriptor.mjs:131-178,theme-discovery.mjs:35-48). - Claim: this follows up #14147 at a maintainer's suggestion. Verified (the maintainer's comment there invites the split if it keeps one discovery path).
- Claim: before, the icon modules pulled
compile.mjs,docs-discovery.mjs,doc-compiler/import.mjsandfs/import-url.mjsin throughtheme-discovery.mjs. Verified (static import trace of the base). - Claim: a bundler following
icon-set-discovery.mjsmet the dynamicimport(url). Reported; the trace confirms the path. - Claim: no behavior change; callers keep the same exports, runtime behavior and single discovery path. Verified (23 exports before and after, 21 moved declarations code-identical, one shared module, related tests pass locally).
- Claim: the five exports move to
static-descriptor.mjs, and the descriptor cache leavestheme-discovery.mjs. Verified; the cache moved with its only reader (static-descriptor.mjs:28). - Claim:
theme-discovery.mjsre-exports the five. Verified (:35-48). - Claim: the icon modules import from
static-descriptor.mjs. Verified (icon-set-discovery.mjs:36-39,icon-definition-discovery.mjs:22). - Claim: a
[chore] Internal:changeset is added. Verified; the changeset check passes locally. - Claim:
static-descriptor.mjsimports onlynode:fs,stored-docs.mjs,read-record.mjsandlazy-dependencies.mjs, with no path todoc-compiler/import.mjsorfs/import-url.mjs. Verified directly (:14-21) and over the full static import graph of both icon modules. - Claim: the strict typecheck has no errors in the touched files and two existing template errors. Reported; reproduced locally (exactly those two).
- Claim: no workflow, action or CI script changes. Verified.
- Claim: no public API, behavior, visual or policy change, and no internal context. Verified.
- Claim: the pre-review checklist and pre-commit checks pass. Reported; the changeset, CLI structure, package boundary and Prettier checks pass locally.
- Claim, changeset: the icon modules no longer import
doc-compiler/compile.mjs, whose graph reachesimport(url)infs/import-url.mjs. Verified (static import trace). - File
.changeset/static-descriptor-split.md: clear. - File
packages/cli/foundation/discovery/icon-definition-discovery.mjs: clear. - File
packages/cli/foundation/discovery/icon-set-discovery.mjs: clear. - File
packages/cli/foundation/discovery/static-descriptor.mjs: the non-blocking note above. - File
packages/cli/foundation/discovery/theme-discovery.mjs: clear. - File
packages/cli/scripts/generate-stored-docs.mjs: clear.
|
🤖 (Posted by Cindy's agent.) Thanks for restoring the JSDoc, @Rajratna-D! One small leftover from the split, to keep the review completely clean: two importers still import through |
|
🤖 (Posted by Cindy's agent.) A correction to my earlier note, @Rajratna-D: the re-export paths are fine as they are. What the latest review actually lists is four doc lines that didn't move with the code. Please carry these over verbatim from |
|
@cixzhang Restored those four JSDoc blocks verbatim in |
|
/approve-spec a68dbf4 |
There was a problem hiding this comment.
Approved pending CI: the CLI smoke test passes on this head, and the CI and Lint runs are still in progress.
The split is clean: the moved code is identical, theme-discovery.mjs keeps every export, neither icon module's import graph reaches doc-compiler/compile.mjs or fs/import-url.mjs any more, and every doc comment from the earlier rounds is back verbatim (traced locally, and the related tests pass locally). Thank you for carrying those over!
Claims and files checked
Review mode: full; reason: author-not-engowner
- Claim, title: the static descriptor reader is split out of theme discovery. Verified (
static-descriptor.mjs:131-178,theme-discovery.mjs:35-48). - Claim: this follows up #14147 at a maintainer's suggestion. Verified (the maintainer's comment there invites the split if it keeps one discovery path).
- Claim: before, the icon modules pulled
compile.mjs,docs-discovery.mjs,doc-compiler/import.mjsandfs/import-url.mjsin throughtheme-discovery.mjs. Reported; a static import trace of the base confirms each step. - Claim: a bundler following
icon-set-discovery.mjsmet the dynamicimport(url). Reported; the trace confirms the path. - Claim: no behavior change; every caller of the three modules keeps the same exports, runtime behavior and single discovery path. Verified (23 exports before and after, moved code identical line by line, one definition of the reader and one shared cache, related tests pass locally).
- Claim: the five exports move to
static-descriptor.mjs, and the descriptor cache leavestheme-discovery.mjs. Verified; the cache moved with its only reader (static-descriptor.mjs:28). - Claim:
theme-discovery.mjsre-exports the five moved exports unchanged. Verified (:35-48). - Claim: the icon modules import from
static-descriptor.mjs. Verified (icon-set-discovery.mjs:36-39,icon-definition-discovery.mjs:22). - Claim: a
[chore] Internal:changeset is added. Verified; the changeset check passes locally. - Claim:
static-descriptor.mjsimports onlynode:fs,stored-docs.mjs,read-record.mjsandlazy-dependencies.mjs, with no path todoc-compiler/import.mjsorfs/import-url.mjs. Verified directly (:14-21) and over the full static import graph of both icon modules. - Claim: the strict typecheck has no errors in the touched files and two existing template errors. Reported; reproduced locally (exactly those two).
- Claim: no workflow, action or CI script changes. Verified.
- Claim: scope is the CLI package, with no public API, behavior, visual or policy change and no internal context. Verified.
- Claim: product changes found during the work were removed or split. Reported; the diff holds only the move.
- Claim: the pre-review checklist and pre-commit checks pass. Reported; the changeset, CLI structure, package boundary and Prettier checks pass locally.
- Claim, changeset: the icon modules no longer import
doc-compiler/compile.mjs, whose graph reachesimport(url)infs/import-url.mjs. Verified (static import trace). - File
.changeset/static-descriptor-split.md: clear. - File
packages/cli/foundation/discovery/icon-definition-discovery.mjs: clear. - File
packages/cli/foundation/discovery/icon-set-discovery.mjs: clear. - File
packages/cli/foundation/discovery/static-descriptor.mjs: clear. - File
packages/cli/foundation/discovery/theme-discovery.mjs: clear. - File
packages/cli/scripts/generate-stored-docs.mjs: clear.
cixzhang
left a comment
There was a problem hiding this comment.
Approved at this exact head.
Follow-up to #14147 per @cixzhang's suggestion.
Maintainer impact
packages/cli/foundation/discovery/icon-set-discovery.mjsandpackages/cli/foundation/discovery/icon-definition-discovery.mjspreviously importedreadStaticDescriptorValueandisIgnoredThemeEntryfromtheme-discovery.mjs, which pulleddoc-compiler(compile.mjs→docs-discovery.mjs→doc-compiler/import.mjs→fs/import-url.mjs) into static icon-set discovery's module graph. Any bundler or static analyzer followingicon-set-discovery.mjs(such as Webpackcache.buildDependencies) encounteredimport-url.mjs's dynamicimport(url).Intended invariant
No behavior change. All existing callers of
theme-discovery.mjs,icon-set-discovery.mjs, andicon-definition-discovery.mjskeep the exact same exports, runtime behavior, and single discovery path (theme-discovery.mjsre-exports all moved symbols).Change
Smallest mechanism-only refactor with no product behavior change:
readStaticDescriptorValue,isIgnoredThemeEntry,STATIC_DESCRIPTOR_TYPES,descriptorStoreKey, andreadDescriptorSourcefrompackages/cli/foundation/discovery/theme-discovery.mjsintopackages/cli/foundation/discovery/static-descriptor.mjs(and removes the unuseddescriptorReadsmap fromtheme-discovery.mjs).packages/cli/foundation/discovery/theme-discovery.mjsfor existing callers.packages/cli/foundation/discovery/icon-set-discovery.mjsandpackages/cli/foundation/discovery/icon-definition-discovery.mjsto import directly from./static-descriptor.mjs..changeset/static-descriptor-split.md([chore] Internal:).Evidence
packages/cli/foundation/discovery/icon-set-discovery.mjsreachedpackages/cli/foundation/fs/import-url.mjsviatheme-discovery.mjs→doc-compiler/compile.mjs→discovery/docs-discovery.mjs→doc-compiler/import.mjs→fs/import-url.mjs.icon-set-discovery.mjsandicon-definition-discovery.mjsimport fromstatic-descriptor.mjs, which only importsnode:fs,doc-compiler/stored-docs.mjs,fs/read-record.mjs, andruntime/lazy-dependencies.mjs(nodoc-compiler/import.mjsorfs/import-url.mjs).theme-discovery.mjsre-exports all moved symbols unchanged;pnpm -F @astryxdesign/cli typecheck:strictreports 0 errors in the 4 touched CLI discovery files (the only 2 errors are pre-existing in unbuiltassets/templates/pages/*/page.tsximporting@astryxdesign/theme-neutral/built).Scope
Components: packages/cli
Testing
pnpm review:pre --base main(0 findings)pnpm -F @astryxdesign/cli typecheck:strict(0 errors in the 4 touched CLI discovery files)check:changesets,check:cli-structure,check:package-boundaries,prettier): passed